import { PrismaClient } from "@prisma/client";

// 对应分类 id 从 1 到 5
const categories = [
    { name: "推荐", code: "recommend" },
    { name: "热点", code: "hot" },
    { name: "财经", code: "finance" },
    { name: "科技", code: "tech" },
    { name: "时政", code: "politics" }
];

const list = [
    // 推荐 (categoryId: 1)
    {
        title: "如何高效学习编程？这 5 个方法你一定要知道",
        content: "<p>在当今数字化时代，编程已成为一项核心技能。本文将分享五种高效学习编程的方法...</p>",
        excerpt: "掌握高效学习方法，让你的编程之路事半功倍。",
        coverImage: "https://picsum.photos/800/400?random=1",
        author: "李明",
        categoryId: 1
    },
    {
        title: "2025 年最值得期待的旅行目的地",
        content: "<p>从冰岛极光到日本樱花，2025年全球旅行趋势正在悄然变化...</p>",
        excerpt: "探索世界，从这份清单开始。",
        coverImage: "https://picsum.photos/800/400?random=2",
        author: "王小雅",
        categoryId: 1
    },

    // 热点 (categoryId: 2)
    {
        title: "某顶流明星官宣恋情，粉丝炸锅！",
        content: "<p>今日凌晨，知名艺人XXX在社交平台发布长文，正式公布恋情...</p>",
        excerpt: "恋情曝光引发全网热议，相关话题阅读量破10亿。",
        coverImage: "https://picsum.photos/800/400?random=3",
        author: "娱乐前线",
        categoryId: 2
    },
    {
        title: "暴雨致南方多城内涝，应急响应已启动",
        content: "<p>受强降雨影响，广东、广西多地出现严重内涝，当地已启动防汛应急响应...</p>",
        excerpt: "多地启动应急响应，市民出行需注意安全。",
        coverImage: "https://picsum.photos/800/400?random=4",
        author: "新闻快讯",
        categoryId: 2
    },
    {
        title: "AI 绘图引发版权争议，艺术家集体发声",
        content: "<p>随着AI生成图像技术普及，多位艺术家起诉某AI公司侵犯版权...</p>",
        excerpt: "AI创作边界何在？艺术界掀起版权保卫战。",
        coverImage: "https://picsum.photos/800/400?random=5",
        author: "科技观察",
        categoryId: 2
    },

    // 财经 (categoryId: 3)
    {
        title: "A股三大指数集体收涨，科技股领涨",
        content: "<p>今日A股市场表现强劲，上证指数上涨1.2%，创业板指大涨2.5%...</p>",
        excerpt: "市场情绪回暖，科技板块成领涨主力。",
        coverImage: "https://picsum.photos/800/400?random=6",
        author: "财经日报",
        categoryId: 3
    },
    {
        title: "央行宣布降准0.25个百分点，释放长期资金约5000亿元",
        content: "<p>为支持实体经济发展，中国人民银行决定于2025年11月1日下调金融机构存款准备金率...</p>",
        excerpt: "降准落地，流动性有望进一步宽松。",
        coverImage: "",
        author: "经济观察员",
        categoryId: 3
    },
    {
        title: "新能源汽车补贴退坡，车企如何应对？",
        content: "<p>随着国家补贴全面退出，新能源车企正通过技术降本、品牌升级等方式应对挑战...</p>",
        excerpt: "补贴退坡倒逼行业高质量发展。",
        coverImage: "https://picsum.photos/800/400?random=7",
        author: "汽车财经",
        categoryId: 3
    },

    // 科技 (categoryId: 4)
    {
        title: "国产大模型“星辰”发布，性能对标GPT-4",
        content: "<p>今日，国内AI公司DeepMind China发布全新大语言模型“星辰”，在多项基准测试中表现优异...</p>",
        excerpt: "国产大模型再突破，AI竞赛进入新阶段。",
        coverImage: "https://picsum.photos/800/400?random=8",
        author: "AI前沿",
        categoryId: 4
    },
    {
        title: "苹果发布iOS 19开发者预览版，引入AI写作助手",
        content: "<p>在WWDC 2025上，苹果正式推出iOS 19，最大亮点是系统级AI写作与图像生成功能...</p>",
        excerpt: "iOS 19带来革命性AI体验。",
        coverImage: "https://picsum.photos/800/400?random=9",
        author: "数码实验室",
        categoryId: 4
    },
    {
        title: "量子计算取得重大突破，中国团队实现100量子比特纠缠",
        content: "<p>中国科学技术大学潘建伟团队近日在《Nature》发表论文，宣布实现100量子比特的高保真度纠缠...</p>",
        excerpt: "量子霸权争夺战再添新进展。",
        coverImage: "https://picsum.photos/800/400?random=10",
        author: "科学日报",
        categoryId: 4
    },
    {
        title: "SpaceX成功发射第200批星链卫星",
        content: "<p>北京时间10月27日，SpaceX猎鹰9号火箭从佛罗里达州成功发射，将60颗星链卫星送入轨道...</p>",
        excerpt: "星链计划持续推进，全球覆盖加速。",
        coverImage: "",
        author: "航天观察",
        categoryId: 4
    },

    // 时政 (categoryId: 5)
    {
        title: "全国人大常委会通过新修订的《网络安全法》",
        content:
            "<p>2025年10月25日，十四届全国人大常委会第十二次会议表决通过新修订的《中华人民共和国网络安全法》...</p>",
        excerpt: "新法强化数据安全与个人信息保护。",
        coverImage: "https://picsum.photos/800/400?random=11",
        author: "法治中国",
        categoryId: 5
    },
    {
        title: "中国与东盟签署数字经济合作框架协议",
        content: "<p>在2025中国—东盟峰会上，双方签署《数字经济合作框架协议》，推动跨境数据流动与数字基建合作...</p>",
        excerpt: "区域数字经济合作迈出关键一步。",
        coverImage: "https://picsum.photos/800/400?random=12",
        author: "国际观察",
        categoryId: 5
    },
    {
        title: "国务院部署推动大规模设备更新和消费品以旧换新",
        content: "<p>近日，国务院印发《推动大规模设备更新和消费品以旧换新行动方案》...</p>",
        excerpt: "政策加力扩内需，促消费稳增长。",
        coverImage: "",
        author: "政策解读",
        categoryId: 5
    },
    {
        title: "全国碳市场启动扩围，水泥、电解铝行业纳入",
        content: "<p>生态环境部宣布，全国碳排放权交易市场将于2026年纳入水泥、电解铝等高耗能行业...</p>",
        excerpt: "碳市场扩容，绿色转型再提速。",
        coverImage: "https://picsum.photos/800/400?random=13",
        author: "绿色经济",
        categoryId: 5
    },

    // 再补充几篇推荐/热点混合，丰富内容
    {
        title: "每天坚持这3个习惯，让你精力充沛一整天",
        content: "<p>早起喝水、冥想10分钟、规律运动——这些小习惯正在改变千万人的生活...</p>",
        excerpt: "简单习惯，带来巨大改变。",
        coverImage: "https://picsum.photos/800/400?random=14",
        author: "健康生活",
        categoryId: 1
    },
    {
        title: "《黑神话：悟空》全球销量突破2000万份",
        content: "<p>国产3A大作《黑神话：悟空》自发售以来持续热销，Steam同时在线人数峰值破300万...</p>",
        excerpt: "国产游戏扬帆出海，文化输出新典范。",
        coverImage: "https://picsum.photos/800/400?random=15",
        author: "游戏日报",
        categoryId: 2
    },
    {
        title: "年轻人为何越来越不敢结婚？",
        content: "<p>高房价、育儿成本、职场压力……多重因素叠加，让婚姻不再是人生必选项...</p>",
        excerpt: "社会变迁下的婚恋观重塑。",
        coverImage: "https://picsum.photos/800/400?random=16",
        author: "社会观察",
        categoryId: 1
    }
];

export const seedArticle = async (prisma: PrismaClient) => {
    console.log("🌱 Seeding articles...");
    await prisma.article.deleteMany();
    await prisma.article.createMany({
        data: list
    });
    console.log(`✅ Seeded ${list.length} articles.`);
};
